#ifndef __MCS__PARSER_ERROR_EXCEPTION__HPP
#define __MCS__PARSER_ERROR_EXCEPTION__HPP

#include "CompileException.hpp"

class ParsingErrorException : public CompileException
{
public:
	ParsingErrorException(SourceLocation const & location, String const & message)
		: CompileException(location)
		, message_(message)
	{
	}

	String message() const { return message_; }

	virtual std::ostream & stream(std::ostream & str) const
	{
		return CompileException::stream(str) << "parsing error: " << message_;
	}
private:
	String message_;
};

#endif //__MCS__PARSER_ERROR_EXCEPTION__HPP
